package com.dragon.pear.modules.admin.web.controller;

import com.chris.dev.base.libs.v1.http.params.NoneParam;
import com.chris.dev.base.libs.v1.http.results.PageResult;
import com.dragon.common.spring.annotations.ResponseBodyPack;
import com.dragon.common.spring.openapi.AccessToken;
import com.dragon.common.spring.openapi.ApiGroup;
import com.dragon.pear.modules.admin.web.model.result.MockUserItemResult;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;

/**
 * @author Chris Chan
 * Create On 2025/8/26 下午7:10
 * Use for: 管理 接口实现
 * Explain:
 */
@AccessToken
@ResponseBodyPack
@ApiGroup("admin")
@Tag(name = "模拟", description = "管理模块模拟相关接口，用于VUE调试")
@RestController
@RequestMapping("mock")
public class MockController {

    @Operation(summary = "获取用户模拟数据列表", description = "获取用户模拟数据列表")
    @PostMapping("getUserMockItemList")
    public PageResult<MockUserItemResult> getUserMockItemList(@RequestBody NoneParam param) {
        ArrayList<MockUserItemResult> dataList = new ArrayList<>();

        for (int i = 0; i < 10; i++) {
            long i1 = i + 1;
            MockUserItemResult item = MockUserItemResult.of(i1, "user" + i1, "123@qq.com", "13800000000", "admin", true, "2025-08-26 15:00:00");
            dataList.add(item);
        }

        return PageResult.of(1, 10, 99, dataList);
    }
}
